Skip to content

ui: Fix Day Explorer flamegraph root selection for selected tracks - #7187

Open
sanath099 wants to merge 1 commit into
mainfrom
dev/sanathku/fix-flamegraph-root-selection
Open

ui: Fix Day Explorer flamegraph root selection for selected tracks#7187
sanath099 wants to merge 1 commit into
mainfrom
dev/sanathku/fix-flamegraph-root-selection

Conversation

@sanath099

Copy link
Copy Markdown
Contributor

Previously, computeDayExplorerFlameGraph traversed recursively upwards through ancestors to top-level roots (on, off, [Label] ...). This caused top-level table roots to always render at Depth 1 in the flamegraph, nesting the user's selected track deep within the hierarchy.

This patch removes the ancestors and all_nodes CTEs and restricts the recursive hierarchy query to descendants only. As a result, the selected tracks correctly become the Depth 1 roots of the flamegraph with their subtrees nested underneath. Also changes the descendants recursive step from UNION ALL to UNION to prevent duplicate nodes on overlapping selections.

Bug: 482033855

Previously, computeDayExplorerFlameGraph traversed recursively upwards
through ancestors to top-level roots (`on`, `off`, `[Label] ...`). This
caused top-level table roots to always render at Depth 1 in the flamegraph,
nesting the user's selected track deep within the hierarchy.

This patch removes the `ancestors` and `all_nodes` CTEs and restricts the
recursive hierarchy query to `descendants` only. As a result, the selected
tracks correctly become the Depth 1 roots of the flamegraph with their
subtrees nested underneath. Also changes the descendants recursive step
from UNION ALL to UNION to prevent duplicate nodes on overlapping selections.

Bug: 482033855
@github-actions

Copy link
Copy Markdown

🎨 Perfetto UI Builds

@sanath099
sanath099 requested a review from rzuklie August 24, 2026 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant